<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    #app {
      width: 375px;
      height: 677px;
      border: 1px solid #000;
      position: relative;
    }
    header {
      width: 100%;
      height: 60px;
      background-color: lightcoral;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 20px;
    }

    footer {
      position: absolute;
      width: 100%;
      height: 60px;
      bottom: 0;
      left: 0;
      border-top: 1px solid #000;
      display: flex;
      justify-content: space-evenly;
      align-items: center;
    }
    .item {
      width: 335px;
      height: 100px;
      border: 1px solid #000;
      margin: 20px;
    }
  </style>
</head>
<body>
  <div id="app">
    <wb-header></wb-header>
    <wb-list></wb-list>
    <wb-form></wb-form>
  </div>

  <script src="../vue3.js"></script>
  <script>
    const {createApp} = Vue;

    // 局部创建一个头部组件
    const WbHeader = {
      template: `
        <header>微博头部</header>
      `
    }

    const WbListItem = {
      template: `
        <div class="item">
          <h3>山海协作 一场山与海的双向奔赴</h3>  
          <p>习近平在福建工作期间，极具前瞻性、战略性地提出了“山海协作、联动发展”规划。</p>
          <button>点赞</button>
        </div>
      `
    }

    // 内容组件
    const WbList = {
      components: {
        WbListItem
      },
      template: `
        <div>
          <wb-list-item></wb-list-item>  
          <wb-list-item></wb-list-item>  
          <wb-list-item></wb-list-item>  
        </div>
      `
    }

    // 表单组件
    const WbForm = {
      template: `
        <footer>
          <input type="text" />
          <button>提交</button>
        </footer>
      `
    }

    const app = createApp({
      components: {
        WbHeader,
        WbList,
        WbForm
      }
    });

    app.mount("#app");
  </script>
</body>
</html>